have your cake and eat it
(British English) (also have your cake and eat it too North American English, British English)
to have the advantages of something without its disadvantages; to have both things that are available